package com.serenegiant.usbcameratest4;

import android.app.Application;
import android.content.Context;

import com.ansen.http.entity.HttpConfig;
import com.ansen.http.net.HTTPCaller;
import com.tencent.bugly.crashreport.CrashReport;


public class MyApplication extends Application {

    private static MyApplication instance;
    private Context mContext;

    @Override
    public void onCreate() {
        super.onCreate();
        instance = this;
        this.mContext = getApplicationContext();
//        CrashReport.initCrashReport( this.mContext , "c8b7a139bb", true );

        CrashReport.initCrashReport(getApplicationContext());
        HttpConfig httpConfig=new HttpConfig();
        httpConfig.setDebug(true);//是否debug模式 如果是debug模式打印log

        //可以添加一些公共字段 每个接口都会带上
//        httpConfig.addCommonField("pf","android");
//        httpConfig.addCommonField("version_code","1");

        //初始化HTTPCaller类
        HTTPCaller.getInstance().setHttpConfig(httpConfig);
    }

    public static synchronized MyApplication getInstance() {
        return instance;
    }

    public Context getContext() {
        return mContext;
    }

}
